<template>
  <div id="app">
    <School :msg="sc"/>
	<Student :msg="st" />
  </div>
</template>

<script>
import Student from './components/Student.vue'
import School from './components/School.vue'

export default {
  name: 'App',
  data() {
  	return {
		sc:'学校',
		st:'学生'
	}
  },
  components: {
    Student,School
  },
  methods:{
	sendMsgToApp(name){
	  	console.log('sendMsgToApp',name)
	}
  },
  mounted() {
  	this.$bus.$on('sendMsgToApp',this.sendMsgToApp)
  },
  beforeDestroy() {
  	this.$bus.$off('sendMsgToApp')
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
